<%
var headerPart = {
%>
<script type="text/javascript">
    function page(n,s){
        $("#pageNo").val(n);
        $("#pageSize").val(s);
        $("#searchForm").submit();
        return false;
    }
</script>
<% }; %>
<% layout("/layouts/micro.html",{headerSection:headerPart}){ %>
<div class="layui-fluid">
	<div class="layui-card">
	<form id="searchForm" action="${ctx}/sys/log/" method="post" class="layui-form layui-card-header layuiadmin-card-header-auto">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">操作菜单：</label>
				<div class="layui-input-block">
					<input id="title" name="title" type="text" maxlength="50" class="layui-input" value="${log.title}"/>
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label">用户ID：</label>
				<div class="layui-input-block">
					<input id="createBy.id" name="createBy.id" type="text" maxlength="50" class="layui-input"  value="${log.createBy.id!}"/>
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label">日期范围：</label>
				<div class="layui-input-inline">
					<input id="beginDate"  name="beginDate"  type="text" readonly="readonly" class="layui-input" />
					<script>
                        layui.use(['laydate'],function(){
                            var laydate = layui.laydate;
                            laydate.render({
                                elem: '#beginDate',
                                value:"${log.beginDate,dateFormat='yyyy-MM-dd'}"
                            });
                        });
					</script>
				</div>
				<div class="layui-form-mid">--</div>
				<div class="layui-input-inline">
					<input id="endDate"  name="endDate"  type="text" readonly="readonly" class="layui-input" />
					<script>
                        layui.use(['laydate'],function(){
                            var laydate = layui.laydate;
                            laydate.render({
                                elem: '#endDate',
                                value:"${log.endDate,dateFormat='yyyy-MM-dd'}"
                            });
                        });
					</script>
				</div>
			</div>

			<div class="layui-inline">
				<button class="layui-btn layuiadmin-btn-useradmin" lay-submit="" lay-filter="LAY-enrollList-search">
					<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
				</button>
			</div>
		</div>
	</form>
	<div class="layui-card-body">
		<#message content="${message!}"/>
		<table class="layui-table" >
			<thead><tr><th>操作菜单</th><th>操作用户</th><th>所在公司</th><th>所在部门</th><th>URI</th><th>提交方式</th><th>操作者IP</th><th>操作时间</th></thead>
			<tbody>
			<%
				var strEnter = "\n";
				var strTab = "\t";
			%>
			<%for(log in page.list){%>
				<tr>
					<td>${log.title}</td>
					<td>${log.createBy.name}</td>
					<td>${log.createBy.company.name}</td>
					<td>${log.createBy.office.name}</td>
					<td><strong>${log.requestUri}</strong></td>
					<td>${log.method}</td>
					<td>${log.remoteAddr}</td>
					<td>${log.createDate,dateFormat="yyyy-MM-dd"}</td>
				</tr>
				<%if(isNotEmpty(log.exception)){%>
				<tr>
					<td colspan="8" style="word-wrap:break-word;word-break:break-all;">
						异常信息: <br/>
						${strutil.replace(strutil.replace(@Encodes.escapeHtml(log.exception), strEnter, '<br/>'), strTab, '&nbsp; &nbsp; ')}
					</td>
				</tr>
				<%}%>
			<%}%>
			</tbody>
		</table>
		<div class="pagination">${page}</div>
	</div>
	</div>
</div>
<%}%>